#include <stdio.h>
#include <stdlib.h>
#include <complex>
#include <iostream>

using namespace std;
int main(int* argc, char** argv){
  FILE *fid;
  complex<double> *a;
  a = (complex<double>*)malloc(sizeof(complex<double>)*2);
  fid = fopen("data", "rb");
  cout << "fid = " << fid << endl;
  fread(reinterpret_cast<double*>(a), sizeof(double), 4, fid);
  cout << a[0] << endl; 
  cout << a[1] << endl;
  fclose(fid);
  return 1;
}
